home *** CD-ROM | disk | FTP | other *** search
/ Freelog 38 / Freelog038.iso / Bas / Bureautique / Ntl480 / Setup.exe / {app} / Libraries / FormatEmail.clb < prev    next >
Text File  |  2002-06-10  |  4KB  |  78 lines

  1. = V5 MultiLine NoSorting TabWidth=30
  2.  
  3. H=";About this library"
  4. This Clipbook library demonstrates how text can be captured from the Windows Clipboard and formatted. It optionally uses spoken messages to indicate what it is doing in the background. You can download these message sound files by double-clicking on the "Download sounds" Clip.
  5.  
  6. The example used in this library will format an e-mail message by quoting the text for reply (some E-mail programs handle reply-formatting very poorly, but NoteTab can help).
  7.  
  8. When this library is activated by double-clicking on the "Start" Clip, NoteTab will capture all text sent to the Clipboard. The way the Clip has been designed, you should first copy the name of the person who sent you the E-mail, then copy the part of the message you want to reply to. The formatted reply text is then stored in the Windows Clipboard -- ready to be pasted into a new E-mail message.
  9.  
  10. Double-click on the "Stop" Clip or close the library when you have finished capturing E-mails, otherwise any text you copy to the Clipboard will continue to be processed by NoteTab.
  11.  
  12.  
  13. H=";"
  14.  
  15.  
  16. H="Download sounds"
  17. ^!Continue This command will activate your web browser and download the sample sound files used in this library. Continue?
  18. ^!URL http://www.notetab.com/ftp/clipwavs.zip
  19. ^!INFO Once the file has been downloaded to your computer, just unzip its content into the following subdirectory: "^$GetSoundPath$"
  20.  
  21. H=";"
  22.  
  23.  
  24. H="Start"
  25. ;Show Clip wizard and ask user if long message lines should be split
  26. ^!Set %UseColumnWrap%=^?{Limit width of lines?==_Yes|No}; %Columns%=^?{If limit width, maximum line length=68}
  27. ;Set initial values for main variables
  28. ^!Set %CheckClipboard%=True; %PasteInfo%=0
  29. ^!Prompt Capture mode is now enabled
  30.  
  31.  
  32. H="Stop"
  33. ;Stop checking the Windows Clipboard
  34. ^!Set %CheckClipboard%=False
  35. ^!Prompt Clipboard capturing stopped. Double-click on the "Start" Clip if you want to continue
  36.  
  37. H=";"
  38.  
  39.  
  40. H="_OnOpen"
  41. ;Check if this library has been opened before. If it has, skip the instructions below
  42. ^!If ^$GetValue(efoFormatEmail)$ = 1 Exit
  43. ;Save key value to NoteTab's INI file
  44. ^!SaveValue efoFormatEmail=1
  45. ;Show instructions contained in the "About this library" Clip
  46. ^!Clip "About this library"
  47.  
  48. H="_OnClipboardChange"
  49. ;If we are not supposed to check the Windows Clipboard, end this Clip
  50. ^!IfFalse ^%CheckClipboard% End
  51. ;Copy Clipboard text into a variable
  52. ^!Set %ClipboardText%=^$GetClipboard$
  53. ;Check if Clipboard text should contain name of author or message text. If we already have the name of author, take the message text and format it, otherwise jump to the AddName label
  54. ^!IfTrue ^%FormatMessage% AddMessage ELSE AddName
  55.  
  56. :AddMessage
  57. ;Set the FormatMessage variable to 0 to indicate that the next text copied to the Clipboard should correspond to name of author
  58. ^!Set %FormatMessage%=0
  59. ;If user does not want to split lines, jump to MessageToClipboard label
  60. ^!IfTrue ^%UseColumnWrap% Next ELSE MessageToClipboard
  61. ;Split lines contained in variable
  62. ^!Set %ClipboardText%=^$StrSplit("^%ClipboardText%";^%Columns%;True)$
  63.  
  64. :MessageToClipboard
  65. ;Add quote character to the start of each line, then add the author name at the start of the message, and finally copy the resulting text to the Clipboard -- ready for pasting in a new E-mail message
  66. ^!SetClipboard ^%PersonName%:^%NL%^%NL%>^$StrReplace("^p";"^p>";"^%ClipboardText%";True;False)$
  67. ;Play sound file if it exists
  68. ^!Sound ^$GetSoundPath$PasteEmail.wav
  69. ^!Goto End
  70.  
  71. :AddName
  72. ;Set the FormatMessage variable to 1 to indicate that the next text copied to the Clipboard should correspond to message text
  73. ^!Set %FormatMessage%=1
  74. ;Copy the Clipboard text into the PersonName variable
  75. ^!Set %PersonName%=^$StrTrim(^$GetClipboard$)$
  76. ;Play sound file if it exists
  77. ^!Sound ^$GetSoundPath$GotName.wav
  78.